import java.sql.*
import groovy.sql.Sql

class Example {
    static void main(String[] args){
        // creating a connection to the database
        def sql = Sql.newInstance('jdbc:mysql://localhost:3306/demo?useSSL=false','root','1234','com.mysql.jdbc.Driver')

        def sqlstr = """CREATE TABLE Employee
            (
                first_name VARCHAR(20) NOT NULL,
                last_name VARCHAR(20) NOT NULL,
                age int NOT NULL,
                sex BIT NOT NULL,
                Income DECIMAL(18,2),
                PRIMARY KEY(first_name,last_name)
            )"""
        
        sql.execute(sqlstr)

        sql.close()
    }
}